<template>
  <div class="icon-font">
    <svg
      class="icon"
      aria-hidden="true"
      :style="{
        'font-size': fontSize,
        'color': color
      }"
    >
      <use :xlink:href="iconName"></use>
    </svg>
  </div>
</template>

<script>
export default {
  props: {
    name: {
      type: String,
      require: true
    },
    fontSize: String,
    color: String
  },
  computed: {
    iconName () {
      return `#icon-${this.name}`
    }
  }
}
</script>

<style lang="scss" scoped>
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>